
$(document).ready(function () {
    $("a.submit").click(function(ev) {
        ev.preventDefault();
        $(this).parents("form")[0].submit();
    });
	
	$('.search-toggle').click(function(){
		$('.search-form').toggle();
		return false;
	});
});


function beforeSendComment() {
	$(".comment-loader").fadeIn();
}

function commentSendSuccess(data, status) {
	$(".comment-loader").fadeOut("fast");
	$("#comment-form textarea").val("");
	$(".new-comment-block").append(data);
	count = parseInt($(".all-comment-count").html());
	$(".all-comment-count").html(count + 1);
}

function beforeSearchAjaxUpdate() {
    $('.search-form .search-ajax-loader').show();
}

function afterSearchAjaxUpdate() {
	$('.search-form .search-ajax-loader').hide();
}